package com.xh.audit.vo.webform;

import com.mybatisflex.core.query.QueryWrapper;
import com.xh.audit.entity.unituser.Unit;
import lombok.Data;
import lombok.EqualsAndHashCode;

import static com.xh.audit.entity.unituser.table.UnitTableDef.UNIT;

@Data
@EqualsAndHashCode(callSuper = true)
public class UnitQuery extends PageParams<Unit> {
    private Integer auditCode;
    private String auditName;
    private String deptCode;


    public QueryWrapper queryWrapperBuild() {
        QueryWrapper queryWrapper = QueryWrapper.create()
                .and(UNIT.AUDIT_CODE.eq(auditCode))
                .and(UNIT.DEPT_CODE.eq(deptCode))
                .and(UNIT.AUDIT_NAME.likeLeft(auditName));
        return queryWrapper;
    }
}
